import QtQuick 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 1.4

import "../basic"

Item {
    id: customRadioButtonRoot
    height: 25
    width: 155
    property string contentText: ""
    property ExclusiveGroup exclusiveGroup
    property bool isSelect: false
    Component {
        id: radioButtonStyle
        RadioButtonStyle {
            indicator: Rectangle {
                implicitWidth: 24
                implicitHeight: 24
                radius: 12
                color: "transparent"
                border.color: "#eb4d44"
                border.width: 1
                Rectangle {
                    anchors.fill: parent
                    visible: control.checked
                    color: "#eb4d44"
                    radius: width / 2
                    anchors.margins: 5
                }
            }
            label: Text {
                color: "white"
                font.pixelSize: 18
                font.family: BasicConfig.commFont
                verticalAlignment: Text.AlignVCenter
                height: 25
                width: implicitWidth
                text: control.text
            }
        }
    }

    RadioButton {
        text: qsTr(customRadioButtonRoot.contentText)
        anchors.verticalCenter: parent.verticalCenter
        style: radioButtonStyle
        exclusiveGroup: customRadioButtonRoot.exclusiveGroup
        checked: isSelect
    }
}
